package com.toncen.samepms.fisher.condition;

import com.sky.fisher.condition.AbstractCondition;
import com.sky.fisher.condition.ConditionEnum;
import com.sky.fisher.model.CommonColumnModel;

public class ChannelNotEqulasCondition extends AbstractCondition {

	public ChannelNotEqulasCondition() {
		super(ConditionEnum.STRING_NOTEQULAS);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.sky.fisher.filter.AbstractCondition#getConditionSQL(com.sky.fisher.model.CommonColumnModel,
	 *      java.lang.String)
	 */
	@Override
	public String getConditionSQL(CommonColumnModel column, String value) throws Exception {
		StringBuffer conditionSQL = new StringBuffer();
		conditionSQL.append(" and " + column.getField() + " in " + //
				"(" + //
				" select channel_id from system_role, net_role_channel	" + //
				" where system_role.state = 1 	" + //
				" and system_role.name != '" + value + "' " + //
				" and system_role.id = net_role_channel.role_id	" + //
				" ) ");
		return conditionSQL.toString();
	}

}
